Analysis of Boyer and Moore's MJRTY algorithm
نویسندگان
چکیده
Given a set {x1, x2, . . . , xn}, each element of which is colored either red or blue, we must determine an element of the majority color by making equal/not equal color comparisons xu : xv; when n is even, we must report that there is no majority if there are equal numbers of each color. How many such questions are necessary and sufficient? It is easy to obtain an algorithm using at most n−ν(n) questions, where ν(n) denotes the number of 1-bits in the binary representation of n; furthermore, n− ν(n) is a lower bound on the number of questions needed (see [5] and [1]). In [2], the average case was investigated: Assuming all 2 distinct colorings of the n elements are equally probable, 2n 3 − √
منابع مشابه
Mjrty|a Fast Majority Vote Algorithm 1
A new algorithm is presented for determining which, if any, of an arbitrary number of candidates has received a majority of the votes cast in an election. The number of comparisons required is at most twice the number of votes. Furthermore, the algorithm uses storage in a way that permits an eecient use of magnetic tape. A Fortran version of the algorithm is exhibited. The Fortran code has been...
متن کاملA new method to obtain the shift-table in Boyer-Moore's string matching algorithm
The Boyer-Moore algorithm uses two pre-computed tables for searching a string: skip, which utilizes the occurrence heuristic of symbols in a pattern, and shift, which utilizes the match heuristic of the pattern. Researchers have pointed out that the difficulty of understanding the computation of the shift table has hindered utilization of the algorithm in a wider range of applications. This pap...
متن کاملOn the shift-table in Boyer-Moore's String Matching Algorithm
The Boyer-Moore’s string matching algorithm uses two pre-computed tables skip, which utilizes the occurrence heuristic of symbols in a pattern, and shift, which utilizes the match heuristic of the pattern, for searching a string. Some experts have pointed out that the difficulty of understanding the computation of the shift table has hindered utilization of the algorithm in a wider range of app...
متن کاملA Proof Method based on Folding Lemmas : Applications to Algorithm
In Fri92] a proof method was developed for proving arithmetic consequences of Horn clause programs deened over integer lists and integers. To be applicable, the method requires the recursion schemes of all predicates involved to be compatible. This is to guarantee a sequence of unfold transformations to eventually lead to a foldable clause. In this paper we consider the case when such a compati...
متن کاملReasoning About Functional Programs in Nuprl
There are two ways of reasoning about functional programs in the constructive type theory of the Nuprl proof development system. Nuprl can be used in a conventional program-veriication mode, in which functional programs are written in a familiar style and then proven to be correct. It can also be used in an extraction mode, where programs are not written explicitly, but instead are extracted fr...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Inf. Process. Lett.
دوره 113 شماره
صفحات -
تاریخ انتشار 2013